//
// Created by ZLY on 2025/5/9.
//

#ifndef COLLIDER_H
#define COLLIDER_H

#include "../core/object_affiliate.h"
class Spell;

class Collider : public ObjectAffiliate {
protected:
    friend Spell;

    enum class Type {
        CIRCLE, //size_的x轴为直径
        RECTANGLE
    };

    Type type_ = Type::CIRCLE;

public:
    void render() override;

    static Collider *addColliderChild(ObjectScreen *parent, glm::vec2 size, Type type = Type::CIRCLE,
                                      Anchor anchor = Anchor::CENTER);

    bool isColliding(Collider *other);

    Type getType() const { return type_; }
    void setType(const Type type) { type_ = type; }
};


#endif //COLLIDER_H
